import { AppComponent } from './app-component.entity'
import { Entity, PrimaryGeneratedColumn, ManyToOne, Column, OneToMany } from 'typeorm'
import { App } from './app.entity'
import { AppPageShare } from './app-page-share.entity'

@Entity()
export class AppPage {
  @PrimaryGeneratedColumn()
  id: number

  @ManyToOne(type => App, app => app.pages)
  app: App

  @Column()
  path: string

  @Column()
  navigationBarBackgroundColor: string

  @Column()
  navigationBarTextStyle: string

  @Column()
  navigationBarTitleText: string

  @Column()
  backgroundColor: string

  @Column()
  backgroundTextStyle: string

  @Column()
  enablePullDownRefresh: boolean

  @Column()
  disableScroll: boolean

  @Column()
  onReachBottomDistance: number

  @OneToMany(type => AppPageShare, share => share.page)
  share: AppPageShare

  @OneToMany(type => AppComponent, component => component.page)
  components: AppComponent[]
}
